94728b736ce6df2dbae6c827fd320569a658e14b,platform/core-impl/src/com/intellij/psi/impl/source/tree/CompositeElement.java,CompositeElement,findLeafElementAt,#number#,161
Before Change
TreeElement child = element.getFirstChildNode();
while (child != null) {
final int textLength = child.getTextLength();
if (textLength > offset) {
if (child instanceof LeafElement) {
if (child instanceof ForeignLeafPsiElement) {
child = child.getTreeNext();
continue;
}
return (LeafElement)child;
After Change
}
while (child != null) {
final int textLength = child.getTextLength();
if (textLength > offset || !fwd && textLength >= offset) {
if (child instanceof LeafElement) {
if (child instanceof ForeignLeafPsiElement) {
child = fwd ? child.getTreeNext() : child.getTreePrev();
continue;
}
return (LeafElement)child;